<template>
  <div class="app-container">
    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="单位id">
        <el-input v-model="form.institutionId" />
      </el-form-item>

      <el-form-item label="村庄名称">
        <el-input v-model="form.name" />
      </el-form-item>

      <el-form-item style="text-align: center;">
        <el-button type="primary" @click="onSubmit">添加</el-button>
        <el-button @click="onCancel">关闭</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import request from '@/utils/request'
export default {
  data() {
    return {
      form: {
        name: ''
      }
    }
  },
  created() {
    // this.ee();
  },
  methods: {
    onSubmit() {
      this.$message('submit!')
      request({
        url: '/api/village/addVillage',
        method: 'post',
        data: this.form
      }).then((res) => {
        console.log(res)
        this.$message(res.resultCodeDesc)
      }).catch((err) => {

      })
    },
    onCancel() {
      this.$message({
        message: 'cancel!',
        type: 'warning'
      })
    },
  }
}
</script>

<style scoped>

</style>
